/**
 * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **/

.cart-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.cart-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #4CAF50;
  border: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s, background-color 0.2s;
}

.cart-button:hover {
  transform: scale(1.05);
  background-color: #388E3C;
}

.cart-icon {
  font-size: 24px;
}

.cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #f44336;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cart-popover {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 350px;
  max-height: 400px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cart-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
}

.cart-popover-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #333;
}

.cart-close-button {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #666;
  padding: 4px;
}

.cart-close-button:hover {
  color: #333;
}

.cart-items {
  overflow-y: auto;
  padding: 8px 0;
  max-height: 280px;
}

.cart-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-item-details {
  display: flex;
  gap: 12px;
  cursor: pointer;
}

.cart-item-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

.cart-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cart-item-name {
  margin: 0 0 4px 0;
  font-size: 0.95rem;
  color: #333;
}

.cart-item-price {
  margin: 0;
  font-weight: bold;
  color: #e53935;
  font-size: 0.9rem;
}

.cart-item-quantity {
  font-size: 0.85rem;
  color: #666;
}

.cart-item-remove {
  background: none;
  border: none;
  color: #f44336;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px;
  align-self: flex-end;
  margin-top: -20px;
}

.cart-item-remove:hover {
  text-decoration: underline;
}

.cart-footer {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid #eee;
  background-color: #f9f9f9;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  margin-bottom: 12px;
  color: #333;
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.place-order-in-cart {
  background-color: #ff9800;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.place-order-in-cart:hover {
  background-color: #f57c00;
}

.place-order-in-cart:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.cart-checkout {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 4px;
  width: 100%;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.cart-checkout:hover {
  background-color: #388E3C;
}

.cart-empty {
  padding: 24px 16px;
  text-align: center;
  color: #666;
}

.cart-shop-now {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  margin-top: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.cart-shop-now:hover {
  background-color: #388E3C;
}

.cart-loading {
  padding: 24px 16px;
  text-align: center;
  color: #666;
}